// 关于加油站和撕逼墙这两个的api
// 添加某个加油站动态评论
let addCheerCommentUrl = 'ido/app/cheerComment'
// 获取某个加油站动态的评论
let getCheerComentUrl = 'ido/app/cheerComment/list/'
// 添加一个加油站动态
let addCheerMomentUrl = 'ido/app/cheerMoment'
// 获取加油站动态数据
let getCheerMomentListUrl = 'ido/app/cheerMoment/list'
// 加油站用户删除点赞
let delCheerMomentThumbUrl = 'ido/app/cheerThumb'
// 删除一个加油站动态
let delCheerMomentUrl = 'ido/app/cheerMoment'
// 用户进行点赞-加油站
let clickCheerMomentThumbUrl = 'ido/app/cheerThumb'
// 查询加油站某个评论的详情
let queryCheerMomentUrl = 'ido/app/cheerMoment/'

// 添加某个撕逼墙动态评论 
let addAnonymousCommentUrl = 'ido/app/anonymousComment'
// 获取某个撕逼墙动态的评论
let getAnonymousCommentUrl = 'ido/app/anonymousComment/list'
// 添加一个撕逼墙动态
let addAnonymousMomentUrl = 'ido/app/anonymousMoment'
// 获取撕逼墙动态数据
let getAnonymousMomentListUrl = 'ido/app/anonymousMoment/list'
// 删除点赞-撕逼墙
let delAnonymousMomentThumbUrl = 'ido/app/anonymousThumb'
// 删除一个撕逼墙动态
let delAnonymousMomentUrl = 'ido/app/anonymousMoment'
// 用户进行点赞-撕逼墙
let clickAnonymousMomentThumbUrl = 'ido/app/anonymousThumb'
// 查询撕逼墙某个动态的详情
let queryAnonymousMomentUrl = 'ido/app/anonymousMoment/'

// 我的动态所需的查询接口
let personalMomentUrl = 'ido/app/personalMoment'
let personalCommentUrl = 'ido/app/personalMoment/momentByComment'

// 获取加油站上面的轮播图
let topicImageUrl = 'ido/app/topicImg'


function intershipApi(vm) {
	// 是指获取数据数组中的(pageNum-1)*pageSize至pageNum*pageSize的数据，总共pageSize条数据
	let getCheerMoment = (pageNum = 1, pageSize = 5) => vm.$u.get(getCheerMomentListUrl + `?pageNum=${pageNum}` +
		`&pageSize=${pageSize}`)
	let addCheerComment = (param = {}) => vm.$u.post(addCheerCommentUrl, param)
	let addCheerMoment = (param = {}) => vm.$u.post(addCheerMomentUrl, param)
	let delCheerMomentThumb = (param = {}) => vm.$u.delete(delCheerMomentThumbUrl, param)
	let clickCheerMomentThumb = (param = {}) => vm.$u.post(clickCheerMomentThumbUrl, param)
	let queryCheerMoment = (momentId) => vm.$u.get(queryCheerMomentUrl + momentId)
	let delCheerMoment = (param = {}) => vm.$u.delete(delCheerMomentUrl, param)

	let addAnonymousComment = (param = {}) => vm.$u.post(addAnonymousCommentUrl, param)
	let addAnonymousMoment = (param = {}) => vm.$u.post(addAnonymousMomentUrl, param)
	let delAnonymousMomentThumb = (param = {}) => vm.$u.delete(delAnonymousMomentThumbUrl, param)
	let clickAnonymousMomentThumb = (param = {}) => vm.$u.post(clickAnonymousMomentThumbUrl, param)
	let getAnonymousMoment = (pageNum = 1, pageSize = 5) => vm.$u.get(getAnonymousMomentListUrl +
		`?pageNum=${pageNum}` + `&pageSize=${pageSize}`)
	let queryAnonymousMoment = (momentId) => vm.$u.get(queryAnonymousMomentUrl + momentId)
	let delAnonymousMoment = (param = {}) => vm.$u.delete(delAnonymousMomentUrl, param)
	
	
	let personalMoment = (pageNum = 1, pageSize = 10) => vm.$u.get(personalMomentUrl + `?pageNum=${pageNum}` +
		`&pageSize=${pageSize}`)
	let personalComment = (pageNum = 1, pageSize = 10) => vm.$u.get(personalCommentUrl + `?pageNum=${pageNum}` +
			`&pageSize=${pageSize}`)
			
	let topicImage = ()=> vm.$u.get(topicImageUrl)
	return {
		getCheerMoment,
		addCheerComment,
		getAnonymousMoment,
		addCheerMoment,
		addAnonymousMoment,
		delCheerMomentThumb,
		delCheerMoment,
		clickCheerMomentThumb,
		addAnonymousComment,
		clickAnonymousMomentThumb,
		delAnonymousMomentThumb,
		delAnonymousMoment,
		queryAnonymousMoment,
		queryCheerMoment,
		personalMoment,
		personalComment,
		topicImage
	}
}

export default intershipApi
